package com.pudding.base;

import dev.langchain4j.model.moderation.Moderation;
import dev.langchain4j.model.moderation.ModerationModel;
import dev.langchain4j.model.openai.OpenAiModerationModel;
import dev.langchain4j.model.output.Response;

public class ModerationDemo {
    public static void main(String[] args) {
        ModerationModel model = OpenAiModerationModel.builder()
                .apiKey("demo")
                .modelName("omni-moderation-latest")
                .build();

        Response<Moderation> response = model.moderate("杀⼈偿命，⽋债还钱");
        System.out.println(response.content().flaggedText());
    }
}
